<template>
  <div class="cooperation-container">
    <div class="cooperation-header">
      <h1>合作交流</h1>
      <div class="breadcrumb">
        <router-link to="/">首页</router-link> / 合作交流
      </div>
    </div>
    
    <div class="cooperation-nav">
      <router-link to="/cooperation/industry-exchange" :class="{ active: $route.path === '/cooperation/industry-exchange' }">
        行业交流
      </router-link>
      <router-link to="/cooperation/association" :class="{ active: $route.path === '/cooperation/association' }">
        协会
      </router-link>
      <router-link to="/cooperation/business" :class="{ active: $route.path === '/cooperation/business' }">
        商务合作
      </router-link>
      <router-link to="/cooperation/industry-university" :class="{ active: $route.path === '/cooperation/industry-university' }">
        产学研合作
      </router-link>
    </div>
    
    <div class="cooperation-content">
      <router-view />
    </div>
  </div>
</template>

<script>
export default {
  name: 'Cooperation',
  created() {
    // 如果访问的是父路由，默认重定向到第一个子路由
    if (this.$route.path === '/cooperation') {
      this.$router.push('/cooperation/industry-exchange');
    }
  }
}
</script>

<style scoped>
.cooperation-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.cooperation-header {
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eaeaea;
}

.cooperation-header h1 {
  font-size: 28px;
  color: #333;
  margin-bottom: 10px;
}

.breadcrumb {
  font-size: 14px;
  color: #666;
}

.breadcrumb a {
  color: #0056b3;
  text-decoration: none;
}

.cooperation-nav {
  display: flex;
  margin-bottom: 30px;
  border-bottom: 2px solid #eaeaea;
}

.cooperation-nav a {
  padding: 12px 24px;
  color: #555;
  text-decoration: none;
  font-size: 16px;
  position: relative;
  transition: all 0.3s;
}

.cooperation-nav a:hover {
  color: #0056b3;
}

.cooperation-nav a.active {
  color: #0056b3;
  font-weight: 500;
}

.cooperation-nav a.active:after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #0056b3;
}

.cooperation-content {
  min-height: 500px;
}

@media (max-width: 768px) {
  .cooperation-nav {
    flex-direction: column;
  }
  
  .cooperation-nav a {
    padding: 10px 0;
  }
}
</style> 